package cur.nature.framework.mvc.base;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;

import java.util.Objects;

/**
 * @author wujian
 * @date 2018年6月24日 下午5:35:14
 */
@Data
public class BaseVO {
    @Schema(description = "主键")
    private Long id;
    @Max(3)
    @Min(1)
    @Schema(description = "操作类型: 1-新增, 2-修改, 3-删除")
    private Integer operateType;

    public static final int NEW = 1; // 新增
    public static final int MODIFY = 2; // 修改
    public static final int DELETE = 3; // 删除


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BaseVO baseVO = (BaseVO) o;
        return Objects.equals(id, baseVO.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}

